let globalUserPerms = [];

export const initPermissions = (perms) => {
  globalUserPerms = [];
  globalUserPerms = perms || [];
};

export const hasPermission = (permission, userPerms) => {
  const permsToCheck = userPerms || globalUserPerms;
  return permsToCheck && permsToCheck.includes(permission);
};